package com.uni.dto;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.uni.common.util.SystemConfig;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  代办订单
 * @author yuyanzheng
 *
 */
@NoArgsConstructor
@Data
public class AgentOrderDTO {
	private Long id;
	private Long userId;
	private Long executionUserId;
	private String orderNo;
	private Integer type;
	private String mainPic;
	private String idCardFront;
	private String idCardBack;
	private Long provinceId;
	private String province;
	private Long cityId;
	private String city;
	private String description;
	private String remark;
	private Integer price;
	private Integer status;
	private Integer deleted;
	private Date updateTime;
	private Date createTime;
	
	private UserDTO executionUser;
	
	private UserDTO user;
	
	private AgentOrderAttachDTO agentOrderAttachDTO;
	
	@JsonInclude
	private int operatingType;
	
	//0：不可操作  1：订单发布者   2：订单服务者
	private int isOperating;
	
	//0:未报价  1：已报价
	private int isQuote;
	
	public String getMainPicAll() {
		if(mainPic != null && !mainPic.equals("") && !mainPic.startsWith("http")) {
			return SystemConfig.basePath + mainPic;
		}
		return mainPic;
	}
	
	public String getIdCardFrontAll() {
		if(idCardFront != null && !idCardFront.equals("") && !idCardFront.startsWith("http")) {
			return SystemConfig.basePath + idCardFront;
		}
		return idCardFront;
	}
	
	public String getIdCardBackAll() {
		if(idCardBack != null && !idCardBack.equals("") && !idCardBack.startsWith("http")) {
			return SystemConfig.basePath + idCardBack;
		}
		return idCardBack;
	}
}
